package com.ym.mongo_plus.entity;

import com.mongoplus.annotation.ID;
import com.mongoplus.annotation.collection.CollectionName;
import com.mongoplus.annotation.index.MongoCompoundIndex;
import com.mongoplus.annotation.index.MongoCompoundIndexes;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;

import java.util.Date;

@Accessors(chain = true)
@MongoCompoundIndexes({
        @MongoCompoundIndex(
                name = "idx_order_id_type_record_time",
                value = "{'orderId': 1, 'type': 1, 'recordTime': 1}"
        )
})
@CollectionName("track")
@NoArgsConstructor
@AllArgsConstructor
@Data
public class Track {
    @ID
    private String id;
    private Long orderId;
    private Long driverId;
    private Integer type;
    private String location;
    private Date recordTime;
}
